<?php
class Obj_Acl_Base 
{
	protected $acl;
	
	public function __construct() {
		$this->acl = new Zend_Acl();
	}
	
	public function setPrivilages() {
		$this->acl->allow(USER_TYPE_GUEST, 'default');
		$this->acl->allow(USER_TYPE_GUEST, 'site-admin');
		$this->acl->allow(USER_TYPE_GUEST, 'site-manager');
		//$this->acl->deny
	}
	
	public function setResources() {
		$this->acl->addResource(new Zend_Acl_Resource('default'));
		$this->acl->addResource(new Zend_Acl_Resource('site-admin'));
		$this->acl->addResource(new Zend_Acl_Resource('site-manager'));
	}
	
	public function setRoles() {
		$this->acl->addRole(new Zend_Acl_Role(USER_TYPE_GUEST));
		$this->acl->addRole(new Zend_Acl_Role(USER_TYPE_ADMIN));
		$this->acl->addRole(new Zend_Acl_Role(USER_TYPE_MANAGER));
	}

	public function setAcl() {
		Zend_Registry::set('acl', $this->acl);
	}
}
